//
//  DesSearchCVC.m
//  HappyTrip
//
//  Created by yuxuesong on 15-3-31.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "DesSearchCVC.h"

@implementation DesSearchCVC

- (void)dealloc
{
    [_nameLabel release];
    [_searchDataObj release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.nameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_nameLabel];
        [_nameLabel release];
    }
    return self;
}
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    CGFloat width = self.bounds.size.width;
    CGFloat height = self.bounds.size.height;
    _nameLabel.frame = CGRectMake(0, 0, width, height);
    _nameLabel.textAlignment = NSTextAlignmentCenter;
    _nameLabel.textColor = [UIColor colorWithRed:0 / 255.0 green:170.0 / 255.0 blue:205.0 / 255.0 alpha:1.0];
    _nameLabel.font = [UIFont systemFontOfSize:14];
    _nameLabel.clipsToBounds = YES;
    _nameLabel.backgroundColor = [UIColor whiteColor];
    _nameLabel.layer.cornerRadius = height / 2;
    _nameLabel.layer.borderWidth = 1.0f;
    _nameLabel.layer.borderColor = [UIColor colorWithRed:0 / 255.0 green:170.0 / 255.0 blue:205.0 / 255.0 alpha:1.0].CGColor;
}
- (void)setSearchDataObj:(DesSearchDataObj *)searchDataObj
{
    if (_searchDataObj != searchDataObj) {
        [_searchDataObj release];
        _searchDataObj = [searchDataObj retain];
    }
    _nameLabel.text = _searchDataObj.name;
}


@end
